import { Entity, CreateDate, UpdateDate, PrimaryUuid, ShopGoodId, Title, Price, Digdit, Uuid, Code, Image } from '@sker/core'
import { Unique } from 'typeorm';
@Entity({ name: 'shop_good_option' })
@Unique('UK_SHOP_GOOD_OPTION_GOOD_ID_TITLE', ['good_id', 'title'])
export class ShopGoodOption {
    static title: string = `商品规格`;
    static resource: string = `shop_good_option`;

    @PrimaryUuid({
        primaryKeyConstraintName: "PK_SHOP_GOOD_OPTION_ID"
    })
    id!: string;

    @ShopGoodId({ comment: '商品', nullable: true })
    good_id!: string;

    @Uuid({ nullable: true })
    provider_id: string;

    @Title({ comment: '商品名称' })
    title!: string;

    @Code({ nullable: true })
    name: string;

    @Price({ comment: '市场价' })
    marketprice!: number;

    @Image({ nullable: true })
    cover: string;

    @Price({ comment: '销售价' })
    productprice!: number;

    @Price({ comment: '成本价' })
    costprice!: number;

    @Price({ comment: '原价' })
    originalprice!: number;

    @Price({ comment: '税点' })
    tax: number;

    @Digdit({ comment: '库存数量' })
    stock!: number;

    @Digdit({ comment: '销量' })
    sales!: number;

    @CreateDate({
        comment: '创建日期'
    })
    create_date!: Date;

    @UpdateDate({
        comment: '更新日期'
    })
    update_date!: Date;
}